---
layout: layouts/base.njk
templateClass: elv-default
headerClass: elv-header-default
---
{% include "header.njk" %}

<main class="elv-layout{% if layoutClass %} {{ layoutClass }}{% endif %}">
    <div id="documentation" class="elv-toc">
        <div>
            {% set navPages = collections.all | eleventyNavigation %}
            {% macro renderNavListItem(entry) -%}
            <li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
              <a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
            {%- if entry.children.length -%}
              <ul>
                {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
              </ul>
            {%- endif -%}
            </li>
            {%- endmacro %}

            <ul class="elv-toc-list">
            {%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
            </ul>
        </div>
    </div>

    {{ content | safe }}

    {% include 'components/suggestion-link.html' %}
</main>
